package com.sg.business.commons.field.presentation;

import java.util.List;

import org.eclipse.ui.forms.IFormPart;

import com.sg.widgets.commons.valuepresentation.IValuePresentation;
import com.sg.widgets.part.editor.fields.AbstractFieldPart;

public class StringListFieldPresentation implements IValuePresentation {

	@Override
	public String getPresentValue(IFormPart part) {
		String result = "";
		Object value = ((AbstractFieldPart) part).getValue();
		if (value instanceof List) {
			List<?> list = (List<?>) value;
			for (Object obj : list) {
				if (result != "") {
					result += ",";
				}
				result += obj;
			}
		}
		System.out.println("");
		return result;
	}
}
